home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Scripts / Menu Events 1.2 / Menu Events Help / Menu Events Help.rsrc / STR#_1029.txt < prev    next >
Encoding:
Text File  |  1994-10-17  |  12.2 KB  |  735 lines

  1. 
  2.  
  3. 
  4.  
  5. §
  6.  
  7. §
  8.  
  9. √•Menu Events Suite
  10.  
  11. 
  12.  
  13. 
  14.  
  15. The following is a formal description of the Menu Events suite, in the form
  16.  
  17. used in the Apple Event Registry.
  18.  
  19. 
  20.  
  21. 
  22.  
  23. NOTE:  The C header file ‚ÄúMenu Events.h‚Äù¬†contains the constant
  24.  
  25. definitions which appear here.  The ‚ÄúMenu Events Scripting Addition‚Äù file
  26.  
  27. contains an 'aete' resource which records the following dictionary
  28.  
  29. information, for the benefit of scripting packages such as AppleScript.
  30.  
  31. This package also includes a sample script, ‚ÄúMenu Events Sample
  32.  
  33. Script,‚Äù which demonstrates the usage of the following events and
  34.  
  35. parameters.
  36.  
  37. 
  38.  
  39. 
  40.  
  41. 
  42.  
  43. xApple events defined in the Menu Events suite
  44.  
  45. 
  46.  
  47. Name              Requested action
  48.  
  49. 
  50.  
  51. 
  52.  
  53. Query Menu List   List all application-defined menus
  54.  
  55. Query Menu        List all items in a menu
  56.  
  57. Select Menu Item  Perform a menu command
  58.  
  59. 
  60.  
  61. 
  62.  
  63. 
  64.  
  65. xQuery Menu List - list all application-defined menus
  66.  
  67. 
  68.  
  69. A Query Menu List Apple event asks the application to return a list of
  70.  
  71. records containing information about all menus defined by the application
  72.  
  73. in its menu bar.  This information includes the Apple menu, but not the
  74.  
  75. Help, Keyboard, or Application menus.
  76.  
  77. 
  78.  
  79. 
  80.  
  81. Event Class       kMEEventClass
  82.  
  83. 
  84.  
  85. Event ID          kAEMEQueryMenuList
  86.  
  87. 
  88.  
  89. Parameters        none
  90.  
  91. 
  92.  
  93. Reply Parameters
  94.  
  95. 
  96.  
  97. 
  98.  
  99. keyDirectObject
  100.  
  101.                   Description:  A list of Apple event
  102.  
  103.                                 records, one for each
  104.  
  105.                                 menu, each containing the
  106.  
  107.                                 following parameters
  108.  
  109.                   Descriptor Type:  typeAEList
  110.  
  111.                   Required or Optional?  Required
  112.  
  113. 
  114.  
  115. 
  116.  
  117. 
  118.  
  119.    keyMenuID
  120.  
  121.                   Description:  The ID of the menu, not
  122.  
  123.                                 necessarily equal to the
  124.  
  125.                                 ID of the 'MENU' resource
  126.  
  127.                                 it may have come from
  128.  
  129.                   Descriptor Type:  typeShortInteger
  130.  
  131.                   Required or Optional?  Required
  132.  
  133. 
  134.  
  135. 
  136.  
  137.    keyMenuTitle
  138.  
  139.                   Description:  The title of the menu, as
  140.  
  141.                                 it appears in the menu bar
  142.  
  143.                   Descriptor Type:  typeChar
  144.  
  145.                   Required or Optional?  Required
  146.  
  147. 
  148.  
  149. 
  150.  
  151.    keyMenuEnabled
  152.  
  153.                   Description:  Whether or not the menu, as
  154.  
  155.                                 a whole, is enabled
  156.  
  157.                   Descriptor Type:  typeBoolean
  158.  
  159.                   Required or Optional?  Required
  160.  
  161. 
  162.  
  163. 
  164.  
  165.    keyMenuMDEFID
  166.  
  167.                   Description:  The ID of the menu definition
  168.  
  169.                                 procedure ('MDEF') resource,
  170.  
  171.                                 ordinarily 0; -1 signifies
  172.  
  173.                                 that the definition procedure
  174.  
  175.                                 is not a resource
  176.  
  177.                   Descriptor Type:  typeShortInteger
  178.  
  179.                   Required or Optional?  Required
  180.  
  181. 
  182.  
  183. 
  184.  
  185. 
  186.  
  187. keyMenuEventsTattoo
  188.  
  189.                   Description:  A null parameter to verify
  190.  
  191.                                 that Menu Events handled
  192.  
  193.                                 the event
  194.  
  195.                   Descriptor Type:  typeNull
  196.  
  197.                   Required or Optional?  Required
  198.  
  199. 
  200.  
  201. 
  202.  
  203. 
  204.  
  205. Result Codes
  206.  
  207.                   mBarNFnd        -126    The application has
  208.  
  209.                                           no menu bar
  210.  
  211. 
  212.  
  213. 
  214.  
  215. 
  216.  
  217. 
  218.  
  219. xQuery Menu - list all items in a menu
  220.  
  221. 
  222.  
  223. A Query Menu Apple event asks the application to return a list of records
  224.  
  225. containing information about all items in a given menu.  This information is
  226.  
  227. complete enough to reconstruct the menu, except for the icon resources
  228.  
  229. referenced by the keyMenuItemIcon parameter.
  230.  
  231. 
  232.  
  233. 
  234.  
  235. Event Class       kMEEventClass
  236.  
  237. 
  238.  
  239. Event ID          kAEMEQueryMenu
  240.  
  241. 
  242.  
  243. Parameters
  244.  
  245. 
  246.  
  247. 
  248.  
  249. keyMenuID
  250.  
  251.                   Description:  The ID of the menu, as
  252.  
  253.                                 returned by a Query Menu
  254.  
  255.                                 List Apple event
  256.  
  257.                   Descriptor Type:  typeShortInteger
  258.  
  259.                   Required or Optional?  Required
  260.  
  261. 
  262.  
  263. 
  264.  
  265. Reply Parameters
  266.  
  267. 
  268.  
  269. 
  270.  
  271. keyDirectObject
  272.  
  273.                   Description:  A list of Apple event
  274.  
  275.                                 records, one for each
  276.  
  277.                                 item, each containing the
  278.  
  279.                                 following parameters
  280.  
  281.                   Descriptor Type:  typeAEList
  282.  
  283.                   Required or Optional?  Required
  284.  
  285. 
  286.  
  287. 
  288.  
  289. 
  290.  
  291.    keyMenuItemID
  292.  
  293.                   Description:  The ID of the item, numbered
  294.  
  295.                                 from 1 at the top of the menu
  296.  
  297.                   Descriptor Type:  typeShortInteger
  298.  
  299.                   Required or Optional?  Required
  300.  
  301. 
  302.  
  303. 
  304.  
  305.    keyMenuItemText
  306.  
  307.                   Description:  The text of the item, as
  308.  
  309.                                 it appears in the menu
  310.  
  311.                   Descriptor Type:  typeChar
  312.  
  313.                   Required or Optional?  Required
  314.  
  315. 
  316.  
  317. 
  318.  
  319.    keyMenuItemEnabled
  320.  
  321.                   Description:  Whether or not the item is
  322.  
  323.                                 enabled
  324.  
  325.                   Descriptor Type:  typeBoolean
  326.  
  327.                   Required or Optional?  Required
  328.  
  329. 
  330.  
  331. 
  332.  
  333.    keyMenuItemMark
  334.  
  335.                   Description:  The mark character of the
  336.  
  337.                                 item, in the lower byte
  338.  
  339.                   Descriptor Type:  typeShortInteger
  340.  
  341.                   Required or Optional?  Required
  342.  
  343. 
  344.  
  345. 
  346.  
  347.    keyMenuItemIcon
  348.  
  349.                   Description:  The icon number of the item,
  350.  
  351.                                 which is 256 less than the
  352.  
  353.                                 resource ID of the 'ICON' or
  354.  
  355.                                 'cicn' resource
  356.  
  357.                   Descriptor Type:  typeShortInteger
  358.  
  359.                   Required or Optional?  Required
  360.  
  361. 
  362.  
  363. 
  364.  
  365.    keyMenuItemStyle
  366.  
  367.                   Description:  The style value of the item,
  368.  
  369.                                 in the lower byte
  370.  
  371.                   Descriptor Type:  typeShortInteger
  372.  
  373.                   Required or Optional?  Required
  374.  
  375. 
  376.  
  377. 
  378.  
  379.    keyMenuItemCmd
  380.  
  381.                   Description:  The Command-key equivalent
  382.  
  383.                                 character of the item, in the
  384.  
  385.                                 lower byte
  386.  
  387.                   Descriptor Type:  typeShortInteger
  388.  
  389.                   Required or Optional?  Required
  390.  
  391. 
  392.  
  393. 
  394.  
  395. 
  396.  
  397. keyMenuEventsTattoo
  398.  
  399.                   Description:  A null parameter to verify
  400.  
  401.                                 that Menu Events handled
  402.  
  403.                                 the event
  404.  
  405.                   Descriptor Type:  typeNull
  406.  
  407.                   Required or Optional?  Required
  408.  
  409. 
  410.  
  411. 
  412.  
  413. 
  414.  
  415. Result Codes
  416.  
  417.                   mBarNFnd        -126    The application has
  418.  
  419.                                           no menu bar
  420.  
  421. 
  422.  
  423. 
  424.  
  425.                   noSuchMenuErr   -21000  The application has
  426.  
  427.                                           no such menu
  428.  
  429. 
  430.  
  431. 
  432.  
  433. 
  434.  
  435. 
  436.  
  437. xSelect Menu Item - perform a menu command
  438.  
  439. 
  440.  
  441. A Select Menu Item event requests user interaction to bring the
  442.  
  443. application to the front, then posts mouse events to simulate the selection
  444.  
  445. of the given menu item, with modifier key states as specified.  If the Menu
  446.  
  447. event is correctly handled, and the application reacts to the mouse events
  448.  
  449. in the usual way, the result is as if the user had actually selected that
  450.  
  451. menu item.  Interaction will fail if the application refuses to interact with
  452.  
  453. other processes (kAEInteractWithSelf mode), or, if the application is on
  454.  
  455. another machine and the Menu Events extension has been locked, if it
  456.  
  457. refuses to interact with remote processes (kAEInteractWithLocal mode).
  458.  
  459. 
  460.  
  461. Event Class       kMEEventClass
  462.  
  463. 
  464.  
  465. Event ID          kAEMESelectMenuItem
  466.  
  467. 
  468.  
  469. Parameters
  470.  
  471. 
  472.  
  473. 
  474.  
  475. keyMenuID
  476.  
  477.                   Description:  The ID of the menu, as
  478.  
  479.                                 returned by a Query Menu
  480.  
  481.                                 List Apple event
  482.  
  483.                   Descriptor Type:  typeShortInteger
  484.  
  485.                   Required or Optional?  Required
  486.  
  487. 
  488.  
  489. 
  490.  
  491. keyMenuItemID
  492.  
  493.                   Description:  The ID of the item, numbered
  494.  
  495.                                 from 1 at the top of the menu
  496.  
  497.                   Descriptor Type:  typeShortInteger
  498.  
  499.                   Required or Optional?  Required
  500.  
  501. 
  502.  
  503. 
  504.  
  505. keyShiftKeyPressed
  506.  
  507.                   Description:  Whether the Shift key is
  508.  
  509.                                 pressed at the time of the
  510.  
  511.                                 simulated menu selection
  512.  
  513.                   Descriptor Type:  typeBoolean
  514.  
  515.                   Required or Optional?  Optional
  516.  
  517.                   Default Value:  false
  518.  
  519. 
  520.  
  521. 
  522.  
  523. keyControlKeyPressed
  524.  
  525.                   Description:  Whether the Control key is
  526.  
  527.                                 pressed at the time of the
  528.  
  529.                                 simulated menu selection
  530.  
  531.                   Descriptor Type:  typeBoolean
  532.  
  533.                   Required or Optional?  Optional
  534.  
  535.                   Default Value:  false
  536.  
  537. 
  538.  
  539. 
  540.  
  541. keyOptionKeyPressed
  542.  
  543.                   Description:  Whether the Option key is
  544.  
  545.                                 pressed at the time of the
  546.  
  547.                                 simulated menu selection
  548.  
  549.                   Descriptor Type:  typeBoolean
  550.  
  551.                   Required or Optional?  Optional
  552.  
  553.                   Default Value:  false
  554.  
  555. 
  556.  
  557. 
  558.  
  559. keyCommandKeyPressed
  560.  
  561.                   Description:  Whether the Command key is
  562.  
  563.                                 pressed at the time of the
  564.  
  565.                                 simulated menu selection
  566.  
  567.                   Descriptor Type:  typeBoolean
  568.  
  569.                   Required or Optional?  Optional
  570.  
  571.                   Default Value:  false
  572.  
  573. 
  574.  
  575. 
  576.  
  577. Reply Parameters
  578.  
  579. 
  580.  
  581. 
  582.  
  583. keyMenuEventsTattoo
  584.  
  585.                   Description:  A null parameter to verify
  586.  
  587.                                 that Menu Events handled
  588.  
  589.                                 the event
  590.  
  591.                   Descriptor Type:  typeNull
  592.  
  593.                   Required or Optional?  Required
  594.  
  595. 
  596.  
  597. 
  598.  
  599. 
  600.  
  601. Result Codes
  602.  
  603.                   mBarNFnd        -126    The application has
  604.  
  605.                                           no menu bar
  606.  
  607. 
  608.  
  609. 
  610.  
  611.                   errAENoUserInteraction
  612.  
  613.                                   -1713   The application is
  614.  
  615.                                           refusing to interact
  616.  
  617.                                           with other processes
  618.  
  619.                                           or (if Menu Events
  620.  
  621.                                           extension is locked)
  622.  
  623.                                           with remote processes
  624.  
  625. 
  626.  
  627. 
  628.  
  629.                   noSuchMenuErr   -21000  The application has
  630.  
  631.                                           no such menu
  632.  
  633. 
  634.  
  635. 
  636.  
  637.                   noSuchMenuItemErr
  638.  
  639.                                   -21001  The menu has no
  640.  
  641.                                           such item
  642.  
  643. 
  644.  
  645. 
  646.  
  647.                   menuItemDisabledErr
  648.  
  649.                                   -21002  The item is
  650.  
  651.                                           disabled
  652.  
  653. 
  654.  
  655. 
  656.  
  657.                   menuEventPendingErr
  658.  
  659.                                   -21003  Another Menu event
  660.  
  661.                                           is already pending
  662.  
  663.                                           on this application
  664.  
  665. 
  666.  
  667. 
  668.  
  669. 
  670.  
  671. 
  672.  
  673. xConstants defined in the Menu Events suite
  674.  
  675. 
  676.  
  677. Constant               Value
  678.  
  679. 
  680.  
  681. 
  682.  
  683. kAEMEQueryMenu         'qmn '
  684.  
  685. kAEMEQueryMenuList     'qmn#'
  686.  
  687. kAEMESelectMenuItem    'semi'
  688.  
  689. keyCommandKeyPressed   'comk'
  690.  
  691. keyControlKeyPressed   'conk'
  692.  
  693. keyMenuEnabled         'mnen'
  694.  
  695. keyMenuEventsTattoo    'M√¶nu'
  696.  
  697. keyMenuID              'mnid'
  698.  
  699. keyMenuItemCmd         'micm'
  700.  
  701. keyMenuItemEnabled     'mien'
  702.  
  703. keyMenuItemIcon        'miic'
  704.  
  705. keyMenuItemID          'miid'
  706.  
  707. keyMenuItemMark        'mima'
  708.  
  709. keyMenuItemStyle       'mist'
  710.  
  711. keyMenuItemText        'mite'
  712.  
  713. keyMenuMDEFID          'mndf'
  714.  
  715. keyMenuTitle           'mnti'
  716.  
  717. keyOptionKeyPressed    'optk'
  718.  
  719. keyShiftKeyPressed     'shik'
  720.  
  721. kMEEventClass          'M√¶nu'
  722.  
  723. menuEventPendingErr    -21003
  724.  
  725. menuItemDisabledErr    -21002
  726.  
  727. noSuchMenuErr          -21000
  728.  
  729. noSuchMenuItemErr      -21001
  730.  
  731. 
  732.  
  733. 
  734.  
  735.